//
//  ViewController.m
//  CCFoundation
//
//  Created by zjh on 2021/8/25.
//

#import "ViewController.h"
#import "ViewController1.h"
@interface ViewController ()

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor = UIColor.whiteColor;
    
    self.title = @"第一页";
    CGFloat width = UIScreen.mainScreen.bounds.size.width;
    CGFloat height = UIScreen.mainScreen.bounds.size.height;
    UIButton *btn = [[UIButton alloc] initWithFrame:CGRectMake((width - 100)/2, (height - 40)/2, 100, 40)];
    [btn addTarget:self action:@selector(tapAction) forControlEvents:UIControlEventTouchUpInside];
    btn.backgroundColor = UIColor.yellowColor;
    [self.view addSubview:btn];
    // Do any additional setup after loading the view.
}
- (void)configNavigationBar {
    if (@available(iOS 15.0, *)) {
        UINavigationBarAppearance *barApp = [[UINavigationBarAppearance alloc] init];
        barApp.backgroundColor = UIColor.redColor;
        barApp.shadowColor = UIColor.redColor;
        barApp.titleTextAttributes = self.navigationController.navigationBar.titleTextAttributes;
        self.navigationController.navigationBar.scrollEdgeAppearance = barApp;
        self.navigationController.navigationBar.standardAppearance = barApp;
    }
    [self.navigationController.navigationBar setBarTintColor:UIColor.redColor];
    self.navigationController.navigationBar.tintColor = UIColor.whiteColor;
}
- (void)viewWillAppear:(BOOL)animated{
    [super viewWillAppear:animated];
    [self.navigationController setNavigationBarHidden:NO];
}
-(void)tapAction{
    ViewController1 *vc = [[ViewController1 alloc] init];
    [self.navigationController pushViewController:vc animated:YES];
}

@end
